
import 'package:common_utils/common_utils.dart';
import 'package:oktoast/oktoast.dart';

/// Toast工具类
class Toast {
  Toast._();

  static void show(String? msg, {int duration = 2000}) {
    if (TextUtil.isEmpty(msg)) {
      return;
    }
    showToast(
      msg!,
      duration: Duration(milliseconds: duration),
      dismissOtherToast: true
    );
  }

  static void cancelToast() {
    dismissAllToast();
  }
}
